package br.com.membros.service;

import java.io.Serializable;
import java.util.List;

import br.com.membros.utils.beans.BaseBean;
import br.com.membros.utils.database.interfaces.IServiceBase;
import br.com.membros.utils.service.interfaces.IRMIServices;

public abstract class AbstractGenericRMIService<T extends BaseBean, ID extends Serializable> implements IRMIServices<T, ID> {
	
	protected abstract IServiceBase<T, ID> getService();
	
	@Override
	public T findById(ID id) {
		return getService().findById(id);
	}

	@Override
	public List<T> findAll() {
		return getService().findAll();
	}

	@Override
	public ID insert(T bean) {
		return getService().insert(bean);
	}

	@Override
	public void update(T bean) {
		getService().update(bean);
	}

	@Override
	public void delete(T bean) {
		getService().delete(bean);		
	}	
}